<template>
  <div id='app'>
    <router-view />
  </div>
</template>

<script>
import { generaMenu } from '@/assets/js/menu'
import '@/assets/css/style.min.css'

export default {
  created() {
    if (this.$store.state.userInfo != null) {
      generaMenu()
    }
    this.axios.post('/api/report')
    if (localStorage.getItem("icon") || localStorage.getItem('title')) {
      window.document.title = localStorage.getItem('title') + ' - 运营后台'
      this.setFavicon(localStorage.getItem("icon"))
    }
  },
  methods: {
    setFavicon(ico){
      let link =
        document.querySelector("link[rel*='icon']") ||
        document.createElement("link");
      link.type = "image/x-icon";
      link.href = ico;
      link.rel = "shortcut icon";
      document.getElementsByTagName("head")[0].appendChild(link);
    }
  }
}
</script>
<style lang='css'>
#app {
    font-family: var(--top-font-family);
}

.comment-emoji, .comment-content img {
    width: 30px;
    height: 30px;
}
</style>
